﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Gama.Website
{
    public partial class VisitContext
    {
        public class SessionManager
        {
            private SessionManager() { }

            private static readonly SessionManager instance = new SessionManager();

            internal static SessionManager Instance
            {
                get { return instance; }
            }
            public void Clear()
            {
                HttpContext.Current.Session.RemoveAll();
            }
            public UserIdentity Visitor
            {
                get { return (UserIdentity)HttpContext.Current.Session["Visitor"]; }
                set { HttpContext.Current.Session["Visitor"] = value; }
            }
            public CartManager CartManager
            {
                get { return (CartManager)HttpContext.Current.Session["Cart"]; }
                set { HttpContext.Current.Session["Cart"] = value; }
            }
            public string PreCategory
            {
                get { return (string)HttpContext.Current.Session["PreCategory"]; }
                set { HttpContext.Current.Session["PreCategory"] = value; }
            }
        }
    }
}